Skip to content

Better sanitize attr diagnostic #145182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luca3s
Copy link

@luca3s luca3s commented Aug 9, 2025

While working on a new sanitizer i noticed that the error messages here could be better.
This now differentiates between a wrong / nonexisting sanitizer and a wrong / nonexisting value for a valid sanitizer.

This is my first time doing a PR to rustc, so i could have missed something.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-rustc-dev-guide Area: rustc-dev-guide PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 9, 2025
error: invalid setting for `address`
--> $DIR/invalid-sanitize.rs:15:12
|
LL | #[sanitize(address = "bogus")]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like for this to only mark the "bogus" part. I couldn't figure out how to get the correct span for that.

@luca3s luca3s force-pushed the better-sanitize-diagnostic branch from e327696 to 2b7dbe6 Compare August 11, 2025 20:05
@bors

This comment was marked as resolved.

@luca3s luca3s force-pushed the better-sanitize-diagnostic branch from 2b7dbe6 to cf64064 Compare August 14, 2025 19:04
@bors

This comment was marked as resolved.

@luca3s luca3s force-pushed the better-sanitize-diagnostic branch from cf64064 to afc3b7f Compare August 19, 2025 08:17
@luca3s luca3s marked this pull request as ready for review August 19, 2025 08:18
@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@jdonszelmann
Copy link
Contributor

r? @jdonszelmann

@rustbot rustbot assigned jdonszelmann and unassigned davidtwco Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-rustc-dev-guide Area: rustc-dev-guide PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants